
xui.Class('RAD.org.Main', 'xui.Module',{
    Instance:{
        initialize : function(){ },
        Dependencies:[],
        Required:[
            "RAD.org.OrgInfo",
            "RAD.org.PersonInfo"
        ],
        properties : {
            "path":"form/myspace/versionspace/projectManager/0/RAD/org/Main.cls",
            "projectName":"projectManager"
        },
        events:{},
        functions:{},
        iniComponents : function(){
            // [[Code created by JDSEasy RAD Studio
            var host=this, children=[], properties={}, append=function(child){children.push(child.get(0));};
            xui.merge(properties, this.properties);

            append(
                xui.create("xui.APICaller")
                    .setHost(host,"treeAjax")
                    .setName("treeAjax")
                    .setAutoRun(true)
                    .setQueryURL("/admin/org/getOrgs")
                    .setRequestDataSource([ ])
                    .setResponseDataTarget([
                        {
                            "name":"lefttree",
                            "path":"data",
                            "type":"treeview"
                        }
                    ])
                    .setResponseCallback([ ])
                    .onData([
                        {
                            "args":[
                                "{page.lefttree.setUIValue()}",
                                null,
                                null,
                                "{page.orgId.getValue()}"
                            ],
                            "desc":"动作 1",
                            "method":"call",
                            "target":"callback",
                            "type":"other"
                        },
                        {
                            "args":[
                                "{page.orgloadAjax.invoke()}"
                            ],
                            "desc":"动作 2",
                            "method":"invoke",
                            "redirection":"other:callback:call",
                            "target":"orgloadAjax",
                            "type":"control"
                        },
                        {
                            "args":[
                                "{page.personLoadAjax.invoke()}"
                            ],
                            "desc":"动作 3",
                            "method":"invoke",
                            "redirection":"other:callback:call",
                            "target":"personLoadAjax",
                            "type":"control"
                        }
                    ])
            );

            append(
                xui.create("xui.APICaller")
                    .setHost(host,"delorgAjax")
                    .setName("delorgAjax")
                    .setQueryURL("/admin/org/delOrg")
                    .setRequestDataSource([
                        {
                            "name":"orggrid",
                            "path":"",
                            "type":"treegrid"
                        }
                    ])
                    .setResponseDataTarget([ ])
                    .setResponseCallback([ ])
                    .onData([
                        {
                            "args":[
                                "{page.orgloadAjax.invoke()}"
                            ],
                            "desc":"动作 1",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "redirection":"other:callback:call",
                            "target":"orgloadAjax",
                            "type":"control"
                        },
                        {
                            "args":[
                                "{page.treeAjax.invoke()}"
                            ],
                            "desc":"动作 2",
                            "method":"invoke",
                            "redirection":"other:callback:call",
                            "target":"treeAjax",
                            "type":"control"
                        }
                    ])
            );

            append(
                xui.create("xui.APICaller")
                    .setHost(host,"orgloadAjax")
                    .setName("orgloadAjax")
                    .setQueryURL("/admin/org/getChildOrgs")
                    .setQueryMethod("POST")
                    .setRequestDataSource([
                        {
                            "name":"xui_ui_layout40",
                            "path":"",
                            "type":"form"
                        }
                    ])
                    .setResponseDataTarget([
                        {
                            "name":"orggrid",
                            "path":"data",
                            "type":"treegrid"
                        },
                        {
                            "name":"orgpagebar",
                            "path":"size",
                            "type":"pagebar"
                        }
                    ])
                    .setResponseCallback([ ])
                    .setProxyType("AJAX")
            );

            append(
                xui.create("xui.APICaller")
                    .setHost(host,"delPersonAjax")
                    .setName("delPersonAjax")
                    .setQueryURL("/admin/org/delPerson")
                    .setRequestDataSource([ ])
                    .setResponseDataTarget([ ])
                    .setResponseCallback([ ])
                    .setProxyType("AJAX")
                    .onData([
                        {
                            "args":[
                                "{page.personLoadAjax.invoke()}"
                            ],
                            "desc":"动作 1",
                            "method":"invoke",
                            "redirection":"other:callback:call",
                            "target":"personLoadAjax",
                            "type":"control"
                        }
                    ])
            );

            append(
                xui.create("xui.APICaller")
                    .setHost(host,"personLoadAjax")
                    .setName("personLoadAjax")
                    .setAutoRun(true)
                    .setQueryURL("/admin/org/getPersons")
                    .setQueryMethod("POST")
                    .setRequestDataSource([
                        {
                            "name":"personpagebar",
                            "path":"",
                            "type":"pagebar"
                        },
                        {
                            "name":"xui_ui_layout40",
                            "path":"",
                            "type":"form"
                        }
                    ])
                    .setResponseDataTarget([
                        {
                            "name":"personlist",
                            "path":"data",
                            "type":"treegrid"
                        },
                        {
                            "name":"personpagebar",
                            "path":"size",
                            "type":"pagebar"
                        }
                    ])
                    .setResponseCallback([ ])
            );

            append(
                xui.create("xui.UI.Dialog")
                    .setHost(host,"xui_ui_dialog8")
                    .setLeft("4.166666666666667em")
                    .setTop("2.5em")
                    .setWidth("70.83333333333333em")
                    .setHeight("43.333333333333336em")
                    .setCaption("组织机构管理")
                    .setImageClass("xui-icon-dialog")
            );

            host.xui_ui_dialog8.append(
                xui.create("xui.UI.Layout")
                    .setHost(host,"xui_ui_layout40")
                    .setName("main")
                    .setItems([
                        {
                            "cmd":false,
                            "folded":false,
                            "id":"before",
                            "locked":false,
                            "min":150,
                            "pos":"before",
                            "size":260,
                            "hidden":false
                        },
                        {
                            "id":"main",
                            "min":10,
                            "size":80
                        }
                    ])
                    .setLeft("0em")
                    .setTop("0em")
                    .setType("horizontal")
            );

            host.xui_ui_layout40.append(
                xui.create("xui.UI.Panel")
                    .setHost(host,"xui_ui_panel33")
                    .setLeft("5.833333333333333em")
                    .setTop("22.5em")
                    .setCaption("团队管理")
                    .setImageClass("fa fa-address-book"),
                "before"
            );

            host.xui_ui_panel33.append(
                xui.create("xui.UI.TreeView")
                    .setHost(host,"lefttree")
                    .setName("lefttree")
                    .setItems([
                        {
                            "caption":"团队",
                            "hidden":false,
                            "id":"root",
                            "imageClass":"xui-icon-menu"
                        }
                    ])
                    .setLeft("0em")
                    .setTop("0em")
                    .setIniFold(false)
                    .onItemSelected([
                        {
                            "args":[
                                "{page.orgId.setUIValue()}",
                                null,
                                null,
                                "{args[1].id}"
                            ],
                            "desc":"动作 3",
                            "method":"setUIValue",
                            "redirection":"other:callback:call",
                            "target":"orgId",
                            "type":"control"
                        },
                        {
                            "args":[ ],
                            "desc":"动作 1",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "target":"orgloadAjax",
                            "type":"control"
                        },
                        {
                            "args":[ ],
                            "desc":"动作 4",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "target":"personLoadAjax",
                            "type":"control"
                        }
                    ])
            );

            host.xui_ui_layout40.append(
                xui.create("xui.UI.HiddenInput")
                    .setHost(host,"orgId")
                    .setName("orgId")
                    .setValue(""),
                "main"
            );

            host.xui_ui_layout40.append(
                xui.create("xui.UI.Tabs")
                    .setHost(host,"xui_ui_tabs5")
                    .setName("orglist")
                    .setItems([
                        {
                            "caption":"用户",
                            "hidden":false,
                            "id":"person",
                            "imageClass":"fa fa-newspaper-o"
                        },
                        {
                            "caption":"部门",
                            "hidden":false,
                            "id":"org",
                            "imageClass":"fa fa-bank"
                        }
                    ])
                    .setLeft("0em")
                    .setTop("0em")
                    .setValue("person")
                    .onCmd([
                        {
                            "args":[
                                "{page.delorgAjax.invoke()}"
                            ],
                            "desc":"动作 1",
                            "method":"invoke",
                            "redirection":"other:callback:call",
                            "target":"delorgAjax",
                            "type":"control"
                        }
                    ])
                    .onItemSelected([
                        {
                            "args":[
                                "{page.personLoadAjax.invoke()}"
                            ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"person",
                                    "left":"{args[1].id}"
                                }
                            ],
                            "desc":"动作 1",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "redirection":"other:callback:call",
                            "target":"personLoadAjax",
                            "type":"control"
                        },
                        {
                            "args":[
                                "{page.orgloadAjax.invoke()}"
                            ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"org",
                                    "left":"{args[1].id}"
                                }
                            ],
                            "desc":"动作 2",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "redirection":"other:callback:call",
                            "target":"orgloadAjax",
                            "type":"control"
                        }
                    ]),
                "main"
            );

            host.xui_ui_tabs5.append(
                xui.create("xui.UI.Block")
                    .setHost(host,"xui_ui_block79")
                    .setDock("fill")
                    .setLeft("15.833333333333334em")
                    .setTop("17.5em"),
                "org"
            );

            host.xui_ui_block79.append(
                xui.create("xui.UI.Block")
                    .setHost(host,"xui_ui_block84")
                    .setDock("bottom")
                    .setLeft("15em")
                    .setTop("45em")
                    .setHeight("2.8333333333333335em")
            );

            host.xui_ui_block84.append(
                xui.create("xui.UI.PageBar")
                    .setHost(host,"orgpagebar")
                    .setName("orgpagebar")
                    .setLeft("20.833333333333332em")
                    .setTop("0.8333333333333334em")
                    .setCaption("页码自定义")
            );

            host.xui_ui_block79.append(
                xui.create("xui.UI.TreeGrid")
                    .setHost(host,"orggrid")
                    .setName("orggrid")
                    .setLeft("0em")
                    .setTop("0em")
                    .setRowNumbered(true)
                    .setHeader([
                        {
                            "caption":"组织编号",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":true,
                            "id":"id",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        },
                        {
                            "caption":"组织名称",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":false,
                            "id":"name",
                            "readonly":true,
                            "type":"label",
                            "width":"16em"
                        },
                        {
                            "caption":"管理员",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":false,
                            "id":"leaderName",
                            "readonly":true,
                            "type":"label",
                            "width":"16em"
                        },
                        {
                            "caption":"描述",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":true,
                            "hidden":false,
                            "id":"brief",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        },
                        {
                            "caption":"管理员ID",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":true,
                            "id":"leaderId",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        }
                    ])
                    .setTagCmds([
                        {
                            "caption":"删除",
                            "hidden":false,
                            "id":"del",
                            "itemClass":"fa fa-minus-square-o",
                            "location":"right",
                            "pos":"row"
                        },
                        {
                            "caption":"编辑",
                            "hidden":false,
                            "id":"editor",
                            "itemClass":"fa fa-cog",
                            "location":"right",
                            "pos":"row"
                        }
                    ])
                    .onCmd([
                        {
                            "args":[
                                "{page.delorgAjax.setQueryData()}",
                                null,
                                null,
                                "{args[1].iD}",
                                "orgId"
                            ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"del",
                                    "left":"{args[2]}"
                                }
                            ],
                            "desc":"动作 3",
                            "method":"setQueryData",
                            "redirection":"other:callback:call",
                            "target":"delorgAjax",
                            "type":"control"
                        },
                        {
                            "args":[ ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"del",
                                    "left":"{args[2]}"
                                }
                            ],
                            "desc":"动作 1",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "return":false,
                            "target":"delorgAjax",
                            "type":"control"
                        },
                        {
                            "args":[
                                "{page.show2()}",
                                null,
                                null,
                                null,
                                null,
                                null,
                                "{args[1]}",
                                "{page}"
                            ],
                            "className":"RAD.org.OrgInfo",
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"editor",
                                    "left":"{args[2]}"
                                }
                            ],
                            "desc":"动作 4",
                            "method":"show2",
                            "redirection":"page",
                            "return":false,
                            "target":"RAD.org.OrgInfo",
                            "type":"page"
                        }
                    ])
                    .onDblclickRow([
                        {
                            "args":[
                                "{page.show2()}",
                                null,
                                null,
                                null,
                                null,
                                null,
                                "{args[1]}",
                                "{page}"
                            ],
                            "className":"RAD.org.OrgInfo",
                            "desc":"动作 1",
                            "method":"show2",
                            "redirection":"page",
                            "target":"RAD.org.OrgInfo",
                            "type":"page"
                        },
                        "_orggrid_ondblclickrow"
                    ])
            );

            host.xui_ui_block79.append(
                xui.create("xui.UI.ToolBar")
                    .setHost(host,"xui_ui_toolbar42")
                    .setName("orgtoobar")
                    .setItems([
                        {
                            "caption":"grp1",
                            "hidden":false,
                            "id":"grp1",
                            "sub":[
                                {
                                    "caption":"添加部门",
                                    "hidden":false,
                                    "iconFontSize":"",
                                    "id":"add",
                                    "imageClass":"fa fa-plus-square",
                                    "position":"absolute"
                                },
                                {
                                    "caption":"删除",
                                    "hidden":false,
                                    "iconFontSize":"",
                                    "id":"delete",
                                    "imageClass":"fa fa-remove",
                                    "position":"absolute"
                                },
                                {
                                    "caption":"刷新",
                                    "hidden":false,
                                    "iconFontSize":"",
                                    "id":"reload",
                                    "imageClass":"fa fa-refresh",
                                    "position":"absolute"
                                }
                            ]
                        }
                    ])
                    .setLeft("Infinityem")
                    .setTop("2.5em")
                    .onClick([
                        {
                            "args":[
                                "{page.show2()}",
                                null,
                                null,
                                null,
                                null,
                                "",
                                "{page.getData()}",
                                "{page}"
                            ],
                            "className":"RAD.org.OrgInfo",
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"add",
                                    "left":"{args[1].id}"
                                }
                            ],
                            "desc":"动作 1",
                            "method":"show2",
                            "redirection":"page",
                            "return":false,
                            "target":"RAD.org.OrgInfo",
                            "type":"page"
                        },
                        {
                            "args":[
                                "{page.orgloadAjax.invoke()}"
                            ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"relaod",
                                    "left":"{args[1].id}"
                                }
                            ],
                            "desc":"动作 3",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "redirection":"other:callback:call",
                            "return":false,
                            "target":"orgloadAjax",
                            "type":"control"
                        }
                    ])
            );

            host.xui_ui_tabs5.append(
                xui.create("xui.UI.Block")
                    .setHost(host,"xui_ui_block91")
                    .setDock("fill")
                    .setLeft("19.166666666666668em")
                    .setTop("19.166666666666668em"),
                "person"
            );

            host.xui_ui_block91.append(
                xui.create("xui.UI.Block")
                    .setHost(host,"xui_ui_block97")
                    .setDock("bottom")
                    .setLeft("15em")
                    .setTop("45em")
                    .setHeight("2.8333333333333335em")
            );

            host.xui_ui_block97.append(
                xui.create("xui.UI.PageBar")
                    .setHost(host,"personpagebar")
                    .setName("personpagebar")
                    .setLeft("20.833333333333332em")
                    .setTop("0.8333333333333334em")
                    .setCaption("页码自定义")
            );

            host.xui_ui_block91.append(
                xui.create("xui.UI.TreeGrid")
                    .setHost(host,"personlist")
                    .setName("personlist")
                    .setLeft("0em")
                    .setTop("0em")
                    .setRowNumbered(true)
                    .setHeader([
                        {
                            "caption":"编号",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":true,
                            "id":"iD",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        },
                        {
                            "caption":"登录用户名",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":false,
                            "id":"account",
                            "readonly":true,
                            "type":"label",
                            "width":"12em"
                        },
                        {
                            "caption":"姓名",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":false,
                            "id":"name",
                            "readonly":true,
                            "type":"label",
                            "width":"12em"
                        },
                        {
                            "caption":"手机号码",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":false,
                            "id":"mobile",
                            "readonly":true,
                            "type":"label",
                            "width":"12em"
                        },
                        {
                            "caption":"邮箱",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":true,
                            "hidden":false,
                            "id":"email",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        },
                        {
                            "caption":"orgId",
                            "colResizer":true,
                            "editable":false,
                            "flexSize":false,
                            "hidden":true,
                            "id":"orgId",
                            "readonly":true,
                            "type":"label",
                            "width":"8em"
                        }
                    ])
                    .setTagCmds([
                        {
                            "caption":"删除",
                            "hidden":false,
                            "id":"del",
                            "itemClass":"fa fa-minus-square",
                            "location":"right",
                            "pos":"row"
                        }
                    ])
                    .onCmd([
                        {
                            "args":[
                                "{page.delPersonAjax.setQueryData()}",
                                null,
                                null,
                                "{args[1].iD}",
                                "personId"
                            ],
                            "desc":"动作 2",
                            "method":"setQueryData",
                            "redirection":"other:callback:call",
                            "target":"delPersonAjax",
                            "type":"control"
                        },
                        {
                            "args":[ ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"del",
                                    "left":"{args[2]}"
                                }
                            ],
                            "desc":"动作 1",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "return":false,
                            "target":"delPersonAjax",
                            "type":"control"
                        }
                    ])
                    .onDblclickRow([
                        {
                            "args":[
                                "{page.show2()}",
                                null,
                                null,
                                null,
                                null,
                                null,
                                "{args[1]}",
                                "{page}"
                            ],
                            "desc":"动作 2",
                            "method":"show2",
                            "redirection":"page",
                            "target":"RAD.org.PersonInfo",
                            "type":"page",
                            "className":"RAD.org.PersonInfo",
                            "itaget":"PersonInfo"
                        }
                    ])
            );

            host.xui_ui_block91.append(
                xui.create("xui.UI.ToolBar")
                    .setHost(host,"xui_ui_toolbar49")
                    .setName("persontoolbar")
                    .setItems([
                        {
                            "caption":"grp1",
                            "hidden":false,
                            "id":"grp1",
                            "sub":[
                                {
                                    "caption":"添加",
                                    "hidden":false,
                                    "iconFontSize":"",
                                    "id":"add",
                                    "imageClass":"fa fa-plus-square",
                                    "position":"absolute"
                                },
                                {
                                    "caption":"删除",
                                    "hidden":true,
                                    "iconFontSize":"",
                                    "id":"delete",
                                    "imageClass":"fa fa-remove",
                                    "position":"absolute"
                                },
                                {
                                    "caption":"刷新",
                                    "hidden":false,
                                    "iconFontSize":"",
                                    "id":"reload",
                                    "imageClass":"fa fa-refresh",
                                    "position":"absolute"
                                }
                            ]
                        }
                    ])
                    .setLeft("Infinityem")
                    .setTop("3.3333333333333335em")
                    .onClick([
                        {
                            "args":[
                                "{page.personLoadAjax.invoke()}"
                            ],
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"reload",
                                    "left":"{args[1].id}"
                                }
                            ],
                            "desc":"动作 3",
                            "koFlag":"_DI_fail",
                            "method":"invoke",
                            "okFlag":"_DI_succeed",
                            "redirection":"other:callback:call",
                            "return":false,
                            "target":"personLoadAjax",
                            "type":"control"
                        },
                        {
                            "args":[
                                "{page.show2()}",
                                null,
                                null,
                                null,
                                null,
                                null,
                                "{page.getData()}",
                                "{page}"
                            ],
                            "className":"RAD.org.PersonInfo",
                            "conditions":[
                                {
                                    "symbol":"=",
                                    "right":"add",
                                    "left":"{args[5]}"
                                }
                            ],
                            "desc":"动作 2",
                            "method":"show2",
                            "redirection":"page",
                            "target":"RAD.org.PersonInfo",
                            "type":"page"
                        }
                    ])
            );

            return children;
            // ]]Code created by JDSEasy RAD Studio
        },

        customAppend : function(parent, subId, left, top){
            return false;
        }  } ,
    Static:{
        "designViewConf":{
            "height":1024,
            "mobileFrame":false,
            "width":1280
        }
    }



});